import request from '@/utils/request'

export function getRoleList(params) {
  return request({
    url: '/sys/role',
    params
  })
}
export function getCompany(companyId) {
  return request({
    url: `/company/${companyId}`
  })
}
export function deleteRole(id) {
  return request({
    method: 'delete',
    url: '/sys/role/' + id
  })
}
export function updateRole(data) {
  return request({
    method: 'put',
    url: '/sys/role/' + data.id,
    data
  })
}
export function getRoleDetail(id) {
  return request({
    url: '/sys/role/' + id
  })
}
export function addRole(data) {
  return request({
    method: 'post',
    url: '/sys/role',
    data
  })
}
// 给角色分配权限
export function assignPerm(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
